import request from "@/utils/request";

/**
 * 检验单-列表
 */
export const listCheckProcessApi = (data) => {
  return request({
    url: "/api/report/check/v1/list",
    method: "get",
    params: data,
  });
};

/**
 * 检验单-详情查询
 */
export const getCheckProcessDetailsApi = (id) => {
  return request({
    url: `/api/report/check/v1/details/${id}`,
    method: "get",
  });
};

/**
 * 检验单-保存(修改)
 */
export const updateCheckProcessApi = (id, data) => {
  return request({
    url: `/api/report/check/v1/update/${id}`,
    method: "post",
    data,
  });
};

/**
 * 检验单-提交
 */
export const submitCheckProcessApi = (id) => {
  return request({
    url: `/api/report/check/v1/submit/${id}`,
    method: "post",
  });
};

/**
 * 检验单-撤销
 */
export const revokeCheckProcessApi = (id) => {
  return request({
    url: `/api/report/check/v1/revoke/${id}`,
    method: "post",
  });
};

/**
 * 检验单-审核
 */
export const checkCheckProcessApi = (id) => {
  return request({
    url: `/api/report/check/v1/check/${id}`,
    method: "post",
  });
};

/**
 * 检验单-反审核
 */
export const unCheckProcessApi = (id) => {
  return request({
    url: `/api/report/check/v1/unCheck/${id}`,
    method: "post",
  });
};

/**
 * 检验单-返工
 */
export const reworkProcessApi = (id) => {
  return request({
    url: `/api/check/process/v1/rework/${id}`,
    method: "post",
  });
};
/**
 * 检验单-合格入库单按钮
 */
export const checkProcessGenerateQualifiedApi = (data) => {
  return request({
    url: "/api/report/check/v1/qualified",
    method: "post",
    data,
  });
};

/**
 * 检验单-废品入库单按钮
 */
export const checkProcessGenerateWasteApi = (data) => {
  return request({
    url: "/api/report/check/v1/waste",
    method: "post",
    data,
  });
};

/**
 * 检验单-转出
 */
export const checkProcessTransferOutApi = (data) => {
  return request({
    url: "/api/report/check/v1/transferOut",
    method: "post",
    data,
  });
};

/**
 * 检验单-删除
 */
export const delCheckProcessApi = (id) => {
  return request({
    url: `/api/report/check/v1/del/${id}`,
    method: "post",
  });
};
